package com.wisnews.pojo;

import lombok.Data;

@Data
public class Result<T> {

	/**
	 * 请求响应code，0为成功 其他为失败
	 */
	private String code;
	/**
	 * 响应异常码详细信息
	 */
	private String msg;
	/**
	 * 响应内容 ， code 0 时为 返回 数据
	 */
	private T data;

	public Result(String code, T data) {
		this.code = code;
		this.data = data;
		this.msg = null;
	}

	public Result(String code, String msg, T data) {
		this.code = code;
		this.msg = msg;
		this.data = data;
	}

	public Result(String code, String msg) {
		this.code = code;
		this.msg = msg;
		this.data = null;
	}
}
